function getint : int     % function to return an integer from user input
    var tempvar : string

    loop
	get tempvar % get some input
	exit when strintok (tempvar) % if it can be converted to an integer, exit loop
	put "Bad integer." % since it hasn't left the loop yet, the string entered can not be converted to an integer, print an error message
    end loop

    result strint (tempvar) % return the integer version of the string entered.
end getint
